package org.spiderflow.config;

//@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class ResponseResult<T> {

    private boolean success;  //是否成功
    private String message;//前端提示信息
    private T data;//元数据
    private String code="0"; //状态码
    private String errorcode;
    public boolean isSuccess() {
        return success;
    }
    public void setSuccess(boolean success) {
        this.success = success;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public T getData() {
        return data;
    }
    public void setData(T data) {
        this.data = data;
    }
    public String getErrorcode() {
        return errorcode;
    }
    public void setErrorcode(String errorcode) {
        this.errorcode = errorcode;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public ResponseResult() {
    }

    public ResponseResult(ErrorInfoInterface errorInfo) {  
        this.setSuccess(false);  
        this.setErrorcode(errorInfo.getCode());
        this.setMessage(errorInfo.getMessage());
    }
}  